package com.ia2014.tp.portal2.entities;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Transient;

import com.ia2014.tp.portal2.vo.ModuloVO;
import com.ia2014.tp.portal2.vo.ModuloDespachoVO;
import com.ia2014.tp.portal2.enums.ModulosEnum;

/**
 * Representa un Modulo del Tipo Despacho
 * @author Ignacio Iljin
 *
 */
@Entity
@DiscriminatorValue("despacho")
public class ModuloDespacho extends Modulo{

	public ModuloDespacho() {
		// TODO Auto-generated constructor stub
	}

	@Transient
	@Override
	public ModuloDespachoVO getVO() {
		ModuloDespachoVO moduloDespachoVO = (ModuloDespachoVO) super.getVO();
		
		return moduloDespachoVO;
	}

	@Transient
	@Override
	public void setVO(ModuloVO abstractVO) {
		
		ModuloDespachoVO moduloDespachoVO = abstractVO.getModuloDespachoVO();
		
		super.setVO(moduloDespachoVO);
		
	}

	@Transient
	@Override
	protected ModuloDespachoVO getVOInstance() {
		
		return new ModuloDespachoVO();
	}

	@Transient
	@Override
	public boolean isModuloDeposito() {
		// TODO Auto-generated method stub
		return false;
	}

	@Transient
	@Override
	public boolean isModuloPortal() {
		// TODO Auto-generated method stub
		return false;
	}

	@Transient
	@Override
	public boolean isModuloDespacho() {
		// TODO Auto-generated method stub
		return true;
	}

	@Transient
	@Override
	public boolean isModuloLogistica() {
		// TODO Auto-generated method stub
		return false;
	}
	
	@Transient
	@Override
	public ModulosEnum getTipoModulo() {
		// TODO Auto-generated method stub
		return ModulosEnum.DESPACHO;
	}
}
